/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Daniel Cruz
 */
@Embeddable
public class TelefonoPersonaPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 15)
    @Column(name = "telefono_prs")
    private String telefonoPrs;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 15)
    @Column(name = "prs_identificacion")
    private String prsIdentificacion;

    public TelefonoPersonaPK() {
    }

    public TelefonoPersonaPK(String telefonoPrs, String prsIdentificacion) {
        this.telefonoPrs = telefonoPrs;
        this.prsIdentificacion = prsIdentificacion;
    }

    public String getTelefonoPrs() {
        return telefonoPrs;
    }

    public void setTelefonoPrs(String telefonoPrs) {
        this.telefonoPrs = telefonoPrs;
    }

    public String getPrsIdentificacion() {
        return prsIdentificacion;
    }

    public void setPrsIdentificacion(String prsIdentificacion) {
        this.prsIdentificacion = prsIdentificacion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (telefonoPrs != null ? telefonoPrs.hashCode() : 0);
        hash += (prsIdentificacion != null ? prsIdentificacion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TelefonoPersonaPK)) {
            return false;
        }
        TelefonoPersonaPK other = (TelefonoPersonaPK) object;
        if ((this.telefonoPrs == null && other.telefonoPrs != null) || (this.telefonoPrs != null && !this.telefonoPrs.equals(other.telefonoPrs))) {
            return false;
        }
        if ((this.prsIdentificacion == null && other.prsIdentificacion != null) || (this.prsIdentificacion != null && !this.prsIdentificacion.equals(other.prsIdentificacion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.TelefonoPersonaPK[ telefonoPrs=" + telefonoPrs + ", prsIdentificacion=" + prsIdentificacion + " ]";
    }
    
}
